<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>新增用户</title>
    <link rel="stylesheet" href="/webjars/bootstrap/5.3.3/css/bootstrap.min.css">
</head>
<body>
<h1 class="btn btn-info">新增用户</h1>
<form th:action="@{/users/insert}" method="post"  th:object="${user}">

  <label for="username" >用户名：</label>
  <input type="text" id="username" th:field="*{username}" required><br>
  <span th:if="${#fields.hasErrors('username')}" th:errors="*{username}"></span>


  <label for="username" >密码：</label>
  <input type="text" id="password" th:field="*{password}" required><br>
  <span th:if="${#fields.hasErrors('password')}" th:errors="*{password}"></span>


    <input type="submit" value="保存">
</form>

<script src="/webjars/jquery/3.7.1/jquery.min.js"></script>
<script src="/webjars/bootstrap/5.3.3/js/bootstrap.min.js"></script>
<script src="/webjars/bootstrap/5.3.3/js/bootstrap.bundle.min.js"></script>
</body>
</html>